package design_6_adapter.demo1;

import design_6_adapter.demo1.handler.HandlerAdapter;
import design_6_adapter.demo1.handler.impl.AnnotationMethodHandlerAdapter;

public class HandlerAdapterDemo1 {

	public static void main(String[] args) {
		// 请求接口
		String uri = "/findId.do";
		// 获取默认适配器
		HandlerAdapter handlerAdapter = new AnnotationMethodHandlerAdapter();
		// 根据请求获取能处理改请求的适配器
		handlerAdapter = handlerAdapter.getHandlerAdapter(uri);
		if (handlerAdapter != null) {
			// 调用方法
			Object handle = handlerAdapter.handle(uri);
			System.out.println("请求结果：" + handle);
		}
	}
}
